package com.syg.SpringMVC._02_SpringMVC_view;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 使用视图的逻辑名称,配置前缀和后缀
 */
public class _01_SpringMVC_view implements Controller{
    @Override
    public ModelAndView handleRequest(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.addObject("Message", "使用逻辑名");
        modelAndView.setViewName("_01_SpringMVC_view");
        return modelAndView;
    }
}
